#!/bin/bash

INSTALL_BASE_DIR="$PWD/.."
INSTALL_DIR="$PWD"

echo "Install depended packages....."
apt install -y python3 python3-dev python3-pip

pip3 install --upgrade pip

echo "Installing FFMPEG into: $INSTALL_DIR"

cd "$INSTALL_DIR"

source ./install_ffmpeg.sh

echo "Installing OpenCV with python."

cd "$INSTALL_DIR"

source ./install_opencv_python.sh

echo "Installing video_cap"

cd "$INSTALL_DIR"
cp -r video_cap "$INSTALL_BASE_DIR"/build/
cd "$INSTALL_BASE_DIR"/build/video_cap
#python3 setup.py install
pip3 install -e .

echo "Installing rtsp_streamsync"
cd "$INSTALL_DIR"
cp -r rtsp_streamsync "$INSTALL_BASE_DIR"/build/
cd "$INSTALL_BASE_DIR"/build/rtsp_streamsync
#python3 setup.py install
pip3 install -e .
